package org.rainbowinverted.charging.device.connect.ykc.server.message.in;

import com.seduclive.device.api.operation.constants.gun.DeviceGunHomeStatusEnum;
import com.seduclive.device.api.operation.constants.gun.DeviceGunStatusEnum;
import lombok.Data;
import org.rainbowinverted.charging.device.connect.ykc.server.constants.YkcDeviceGunHomeStatusEnum;
import org.rainbowinverted.charging.device.connect.ykc.server.constants.YkcDeviceGunStatusEnum;

import java.io.Serializable;

/**
 * 设备状态信息
 * @author hehuaiping
 */
@Data
public class YkcDeviceStatusInfoIn implements Serializable {
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 设备编号
     */
    private Long deviceNo;
    /**
     * 枪号
     */
    private Integer gunNo;
    /**
     * 充电枪状态
     * @see YkcDeviceGunStatusEnum
     */
    private String gunStatus;
    /**
     * 枪是否归位
     * @see YkcDeviceGunHomeStatusEnum
     */
    private String gunHomeStatus;
    /**
     * 是否插枪
     */
    private Boolean gunInserted;
    /**
     * 电压
     */
    private Integer voltage;
    /**
     * 电流
     */
    private Integer current;
    /**
     * 枪线温度
     */
    private Integer gunLineTemp;
    /**
     * 枪线编号
     */
    private Long gunLineNo;
    /**
     * soc
     */
    private Integer soc;
    /**
     * 电池组最高温度
     */
    private Integer batteryGroupMaxTemp;
    /**
     * 充电时间
     */
    private Integer chargeTime;
    /**
     * 剩余时间
     */
    private Integer remainingTime;
    /**
     * 充电电量
     */
    private Integer chargeElectricity;
    /**
     * 计损充电电量
     */
    private Integer lossChargeElectricity;
    /**
     * 充电金额
     */
    private Integer chargeAmount;

    public static YkcDeviceStatusInfoIn of(String orderNo, Long deviceNo, Integer gunNo,
                                           String gunStatus, String gunHomeStatus,
                                           Boolean gunInserted, Integer voltage,
                                           Integer current, Integer gunLineTemp,
                                           Long gunLineNo, Integer soc, Integer batteryGroupMaxTemp,
                                           Integer chargeTime, Integer remainingTime, Integer chargeElectricity,
                                           Integer lossChargeElectricity, Integer chargeAmount) {
        return new YkcDeviceStatusInfoIn(orderNo, deviceNo, gunNo, gunStatus, gunHomeStatus,
                gunInserted, voltage, current, gunLineTemp, gunLineNo, soc,
                batteryGroupMaxTemp, chargeTime, remainingTime, chargeElectricity,
                lossChargeElectricity, chargeAmount);
    }

    private YkcDeviceStatusInfoIn(String orderNo, Long deviceNo, Integer gunNo,
                                 String gunStatus, String gunHomeStatus,
                                 Boolean gunInserted, Integer voltage,
                                 Integer current, Integer gunLineTemp,
                                 Long gunLineNo, Integer soc, Integer batteryGroupMaxTemp,
                                 Integer chargeTime, Integer remainingTime, Integer chargeElectricity,
                                 Integer lossChargeElectricity, Integer chargeAmount) {
        this.orderNo = orderNo;
        this.deviceNo = deviceNo;
        this.gunNo = gunNo;
        this.gunStatus = gunStatus;
        this.gunHomeStatus = gunHomeStatus;
        this.gunInserted = gunInserted;
        this.voltage = voltage;
        this.current = current;
        this.gunLineTemp = gunLineTemp;
        this.gunLineNo = gunLineNo;
        this.soc = soc;
        this.batteryGroupMaxTemp = batteryGroupMaxTemp;
        this.chargeTime = chargeTime;
        this.remainingTime = remainingTime;
        this.chargeElectricity = chargeElectricity;
        this.lossChargeElectricity = lossChargeElectricity;
        this.chargeAmount = chargeAmount;
    }
}
